﻿if (!hs) {
    var hs = {
        lang: {
            cssDirection: "ltr",
            loadingText: "正在载入...",
            loadingTitle: "点击取消",
            focusTitle: "点击此图到最前端显示",
            fullExpandTitle: "放大到实际尺寸",
            creditsText: "",
            creditsTitle: "",
            restoreTitle: "单击关闭图片,按住鼠标左键并拖动可以移动图片,方向键可查看上一张或下一张."
        },
        graphicsDir: "/style/plus/highslide/graphics/",
        expandCursor: "zoomin.cur",
        restoreCursor: "zoomout.cur",
        expandDuration: 250,
        restoreDuration: 250,
        marginLeft: 15,
        marginRight: 15,
        marginTop: 15,
        marginBottom: 15,
        zIndexCounter: 1001,
        loadingOpacity: 0.75,
        allowMultipleInstances: true,
        numberOfImagesToPreload: 5,
        outlineWhileAnimating: 2,
        outlineStartOffset: 3,
        padToMinWidth: false,
        fullExpandPosition: "bottom right",
        fullExpandOpacity: 1,
        showCredits: true,
        creditsHref: "http://highslide.com/",
        creditsTarget: "_self",
        enableKeyListener: true,
        openerTagNames: ["a"],
        dragByHeading: true,
        minWidth: 200,
        minHeight: 200,
        allowSizeReduction: true,
        outlineType: "drop-shadow",
        preloadTheseImages: [],
        continuePreloading: true,
        expanders: [],
        overrides: ["allowSizeReduction", "useBox", "outlineType", "outlineWhileAnimating", "captionId", "captionText", "captionEval", "captionOverlay", "headingId", "headingText", "headingEval", "headingOverlay", "creditsPosition", "dragByHeading", "width", "height", "wrapperClassName", "minWidth", "minHeight", "maxWidth", "maxHeight", "pageOrigin", "slideshowGroup", "easing", "easingClose", "fadeInOut", "src"],
        overlays: [],
        idCounter: 0,
        oPos: {
            x: ["leftpanel", "left", "center", "right", "rightpanel"],
            y: ["above", "top", "middle", "bottom", "below"]
        },
        mouse: {},
        headingOverlay: {},
        captionOverlay: {},
        timers: [],
        pendingOutlines: {},
        clones: {},
        onReady: [],
        uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 : parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, "0"])[1]),
        ie: (document.all && !window.opera),
        safari: /Safari/.test(navigator.userAgent),
        geckoMac: /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),
        $: function (a) {
            if (a) {
                return document.getElementById(a)
            }
        },
        push: function (a, b) {
            a[a.length] = b
        },
        createElement: function (f, a, e, d, c) {
            var b = document.createElement(f);
            if (a) {
                hs.extend(b, a)
            }
            if (c) {
                hs.setStyles(b, {
                    padding: 0,
                    border: "none",
                    margin: 0
                })
            }
            if (e) {
                hs.setStyles(b, e)
            }
            if (d) {
                d.appendChild(b)
            }
            return b
        },
        extend: function (b, a) {
            for (var c in a) {
                b[c] = a[c]
            }
            return b
        },
        setStyles: function (a, b) {
            for (var c in b) {
                if (hs.ieLt9 && c == "opacity") {
                    if (b[c] > 0.99) {
                        a.style.removeAttribute("filter")
                    } else {
                        a.style.filter = "alpha(opacity=" + (b[c] * 100) + ")"
                    }
                } else {
                    a.style[c] = b[c]
                }
            }
        },
        animate: function (c, h, g) {
            var i, d, j;
            if (typeof g != "object" || g === null) {
                var a = arguments;
                g = {
                    duration: a[2],
                    easing: a[3],
                    complete: a[4]
                }
            }
            if (typeof g.duration != "number") {
                g.duration = 250
            }
            g.easing = Math[g.easing] || Math.easeInQuad;
            g.curAnim = hs.extend({}, h);
            for (var f in h) {
                var b = new hs.fx(c, g, f);
                i = parseFloat(hs.css(c, f)) || 0;
                d = parseFloat(h[f]);
                j = f != "opacity" ? "px" : "";
                b.custom(i, d, j)
            }
        },
        css: function (a, b) {
            if (a.style[b]) {
                return a.style[b]
            } else {
                if (document.defaultView) {
                    return document.defaultView.getComputedStyle(a, null).getPropertyValue(b)
                } else {
                    if (b == "opacity") {
                        b = "filter"
                    }
                    var c = a.currentStyle[b.replace(/\-(\w)/g, function (d, e) {
                        return e.toUpperCase()
                    })];
                    if (b == "filter") {
                        c = c.replace(/alpha\(opacity=([0-9]+)\)/, function (d, e) {
                            return e / 100
                        })
                    }
                    return c === "" ? 1 : c
                }
            }
        },
        getPageSize: function () {
            var a = document,
				e = window,
				c = a.compatMode && a.compatMode != "BackCompat" ? a.documentElement : a.body;
            var f = hs.ieLt9 ? c.clientWidth : (a.documentElement.clientWidth || self.innerWidth),
				b = hs.ieLt9 ? c.clientHeight : self.innerHeight;
            hs.page = {
                width: f,
                height: b,
                scrollLeft: hs.ieLt9 ? c.scrollLeft : pageXOffset,
                scrollTop: hs.ieLt9 ? c.scrollTop : pageYOffset
            };
            return hs.page
        },
        getPosition: function (a) {
            var b = {
                x: a.offsetLeft,
                y: a.offsetTop
            };
            while (a.offsetParent) {
                a = a.offsetParent;
                b.x += a.offsetLeft;
                b.y += a.offsetTop;
                if (a != document.body && a != document.documentElement) {
                    b.x -= a.scrollLeft;
                    b.y -= a.scrollTop
                }
            }
            return b
        },
        expand: function (b, f, c, g) {
            if (!b) {
                b = hs.createElement("a", null, {
                    display: "none"
                }, hs.container)
            }
            if (typeof b.getParams == "function") {
                return f
            }
            try {
                new hs.Expander(b, f, c);
                return false
            } catch (d) {
                return true
            }
        },
        focusTopmost: function () {
            var e = 0,
				d = -1,
				b = hs.expanders,
				a, f;
            for (var c = 0; c < b.length; c++) {
                a = b[c];
                if (a) {
                    f = a.wrapper.style.zIndex;
                    if (f && f > e) {
                        e = f;
                        d = c
                    }
                }
            }
            if (d == -1) {
                hs.focusKey = -1
            } else {
                b[d].focus()
            }
        },
        getParam: function (b, d) {
            b.getParams = b.onclick;
            var c = b.getParams ? b.getParams() : null;
            b.getParams = null;
            return (c && typeof c[d] != "undefined") ? c[d] : (typeof hs[d] != "undefined" ? hs[d] : null)
        },
        getSrc: function (b) {
            var c = hs.getParam(b, "src");
            if (c) {
                return c
            }
            return b.href
        },
        getNode: function (d) {
            var e = hs.$(d),
				c = hs.clones[d],
				b = {};
            if (!e && !c) {
                return null
            }
            if (!c) {
                c = e.cloneNode(true);
                c.id = "";
                hs.clones[d] = c;
                return e
            } else {
                return c.cloneNode(true)
            }
        },
        discardElement: function (a) {
            if (a) {
                hs.garbageBin.appendChild(a)
            }
            hs.garbageBin.innerHTML = ""
        },
        transit: function (a, c) {
            var d = c || hs.getExpander();
            c = d;
            if (hs.upcoming) {
                return false
            } else {
                hs.last = d
            }
            hs.removeEventListener(document, window.opera ? "keypress" : "keydown", hs.keyHandler);
            try {
                hs.upcoming = a;
                a.onclick()
            } catch (b) {
                hs.last = hs.upcoming = null
            }
            try {
                c.close()
            } catch (b) { }
            return false
        },
        previousOrNext: function (a, c) {
            var b = hs.getExpander(a);
            if (b) {
                return hs.transit(b.getAdjacentAnchor(c), b)
            } else {
                return false
            }
        },
        previous: function (a) {
            return hs.previousOrNext(a, -1)
        },
        next: function (a) {
            return hs.previousOrNext(a, 1)
        },
        keyHandler: function (a) {
            if (!a) {
                a = window.event
            }
            if (!a.target) {
                a.target = a.srcElement
            }
            if (typeof a.target.form != "undefined") {
                return true
            }
            var b = hs.getExpander();
            var c = null;
            switch (a.keyCode) {
                case 70:
                    if (b) {
                        b.doFullExpand()
                    }
                    return true;
                case 32:
                case 34:
                case 39:
                case 40:
                    c = 1;
                    break;
                case 8:
                case 33:
                case 37:
                case 38:
                    c = -1;
                    break;
                case 27:
                case 13:
                    c = 0
            }
            if (c !== null) {
                hs.removeEventListener(document, window.opera ? "keypress" : "keydown", hs.keyHandler);
                if (!hs.enableKeyListener) {
                    return true
                }
                if (a.preventDefault) {
                    a.preventDefault()
                } else {
                    a.returnValue = false
                }
                if (b) {
                    if (c == 0) {
                        b.close()
                    } else {
                        hs.previousOrNext(b.key, c)
                    }
                    return false
                }
            }
            return true
        },
        registerOverlay: function (a) {
            hs.push(hs.overlays, hs.extend(a, {
                hsId: "hsId" + hs.idCounter++
            }))
        },
        getWrapperKey: function (b, d) {
            var a, f = /^highslide-wrapper-([0-9]+)$/;
            a = b;
            while (a.parentNode) {
                if (a.id && f.test(a.id)) {
                    return a.id.replace(f, "$1")
                }
                a = a.parentNode
            }
            if (!d) {
                a = b;
                while (a.parentNode) {
                    if (a.tagName && hs.isHsAnchor(a)) {
                        for (var e = 0; e < hs.expanders.length; e++) {
                            var c = hs.expanders[e];
                            if (c && c.a == a) {
                                return e
                            }
                        }
                    }
                    a = a.parentNode
                }
            }
            return null
        },
        getExpander: function (a, b) {
            if (typeof a == "undefined") {
                return hs.expanders[hs.focusKey] || null
            }
            if (typeof a == "number") {
                return hs.expanders[a] || null
            }
            if (typeof a == "string") {
                a = hs.$(a)
            }
            return hs.expanders[hs.getWrapperKey(a, b)] || null
        },
        isHsAnchor: function (b) {
            return (b.onclick && b.onclick.toString().replace(/\s/g, " ").match(/hs.(htmlE|e)xpand/))
        },
        reOrder: function () {
            for (var a = 0; a < hs.expanders.length; a++) {
                if (hs.expanders[a] && hs.expanders[a].isExpanded) {
                    hs.focusTopmost()
                }
            }
        },
        mouseClickHandler: function (a) {
            if (!a) {
                a = window.event
            }
            if (a.button > 1) {
                return true
            }
            if (!a.target) {
                a.target = a.srcElement
            }
            var b = a.target;
            while (b.parentNode && !(/highslide-(image|move|html|resize)/.test(b.className))) {
                b = b.parentNode
            }
            var c = hs.getExpander(b);
            if (c && (c.isClosing || !c.isExpanded)) {
                return true
            }
            if (c && a.type == "mousedown") {
                if (a.target.form) {
                    return true
                }
                var f = b.className.match(/highslide-(image|move|resize)/);
                if (f) {
                    hs.dragArgs = {
                        exp: c,
                        type: f[1],
                        left: c.x.pos,
                        width: c.x.size,
                        top: c.y.pos,
                        height: c.y.size,
                        clickX: a.clientX,
                        clickY: a.clientY
                    };
                    hs.addEventListener(document, "mousemove", hs.dragHandler);
                    if (a.preventDefault) {
                        a.preventDefault()
                    }
                    if (/highslide-(image|html)-blur/.test(c.content.className)) {
                        c.focus();
                        hs.hasFocused = true
                    }
                    return false
                }
            } else {
                if (a.type == "mouseup") {
                    hs.removeEventListener(document, "mousemove", hs.dragHandler);
                    if (hs.dragArgs) {
                        if (hs.styleRestoreCursor && hs.dragArgs.type == "image") {
                            hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor
                        }
                        var d = hs.dragArgs.hasDragged;
                        if (!d && !hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
                            c.close()
                        } else {
                            if (d || (!d && hs.hasHtmlExpanders)) {
                                hs.dragArgs.exp.doShowHide("hidden")
                            }
                        }
                        hs.hasFocused = false;
                        hs.dragArgs = null
                    } else {
                        if (/highslide-image-blur/.test(b.className)) {
                            b.style.cursor = hs.styleRestoreCursor
                        }
                    }
                }
            }
            return false
        },
        dragHandler: function (d) {
            if (!hs.dragArgs) {
                return true
            }
            if (!d) {
                d = window.event
            }
            var b = hs.dragArgs,
				f = b.exp;
            b.dX = d.clientX - b.clickX;
            b.dY = d.clientY - b.clickY;
            var c = Math.sqrt(Math.pow(b.dX, 2) + Math.pow(b.dY, 2));
            if (!b.hasDragged) {
                b.hasDragged = (b.type != "image" && c > 0) || (c > (hs.dragSensitivity || 5))
            }
            if (b.hasDragged && d.clientX > 5 && d.clientY > 5) {
                if (b.type == "resize") {
                    f.resize(b)
                } else {
                    f.moveTo(b.left + b.dX, b.top + b.dY);
                    if (b.type == "image") {
                        f.content.style.cursor = "move"
                    }
                }
            }
            return false
        },
        wrapperMouseHandler: function (a) {
            try {
                if (!a) {
                    a = window.event
                }
                var d = /mouseover/i.test(a.type);
                if (!a.target) {
                    a.target = a.srcElement
                }
                if (!a.relatedTarget) {
                    a.relatedTarget = d ? a.fromElement : a.toElement
                }
                var b = hs.getExpander(a.target);
                if (!b.isExpanded) {
                    return
                }
                if (!b || !a.relatedTarget || hs.getExpander(a.relatedTarget, true) == b || hs.dragArgs) {
                    return
                }
                for (var c = 0; c < b.overlays.length; c++) {
                    (function () {
                        var e = hs.$("hsId" + b.overlays[c]);
                        if (e && e.hideOnMouseOut) {
                            if (d) {
                                hs.setStyles(e, {
                                    visibility: "visible",
                                    display: ""
                                })
                            }
                            hs.animate(e, {
                                opacity: d ? e.opacity : 0
                            }, e.dur)
                        }
                    })()
                }
            } catch (a) { }
        },
        addEventListener: function (b, c, d) {
            if (b == document && c == "ready") {
                hs.push(hs.onReady, d)
            }
            try {
                b.addEventListener(c, d, false)
            } catch (a) {
                try {
                    b.detachEvent("on" + c, d);
                    b.attachEvent("on" + c, d)
                } catch (a) {
                    b["on" + c] = d
                }
            }
        },
        removeEventListener: function (b, c, d) {
            try {
                b.removeEventListener(c, d, false)
            } catch (a) {
                try {
                    b.detachEvent("on" + c, d)
                } catch (a) {
                    b["on" + c] = null
                }
            }
        },
        preloadFullImage: function (a) {
            if (hs.continuePreloading && hs.preloadTheseImages[a] && hs.preloadTheseImages[a] != "undefined") {
                var b = document.createElement("img");
                b.onload = function () {
                    b = null;
                    hs.preloadFullImage(a + 1)
                };
                b.src = hs.preloadTheseImages[a]
            }
        },
        preloadImages: function (d) {
            if (d && typeof d != "object") {
                hs.numberOfImagesToPreload = d
            }
            var a = hs.getAnchors();
            for (var c = 0; c < a.images.length && c < hs.numberOfImagesToPreload; c++) {
                hs.push(hs.preloadTheseImages, hs.getSrc(a.images[c]))
            }
            if (hs.outlineType) {
                new hs.Outline(hs.outlineType, function () {
                    hs.preloadFullImage(0)
                })
            } else {
                hs.preloadFullImage(0)
            }
            if (hs.restoreCursor) {
                var b = hs.createElement("img", {
                    src: hs.graphicsDir + hs.restoreCursor
                })
            }
        },
        init: function () {
            if (!hs.container) {
                hs.ieLt7 = hs.ie && hs.uaVersion < 7;
                hs.ieLt9 = hs.ie && hs.uaVersion < 9;
                hs.getPageSize();
                for (var a in hs.langDefaults) {
                    if (typeof hs[a] != "undefined") {
                        hs.lang[a] = hs[a]
                    } else {
                        if (typeof hs.lang[a] == "undefined" && typeof hs.langDefaults[a] != "undefined") {
                            hs.lang[a] = hs.langDefaults[a]
                        }
                    }
                }
                hs.container = hs.createElement("div", {
                    className: "highslide-container"
                }, {
                    position: "absolute",
                    left: 0,
                    top: 0,
                    width: "100%",
                    zIndex: hs.zIndexCounter,
                    direction: "ltr"
                }, document.body, true);
                hs.loading = hs.createElement("a", {
                    className: "highslide-loading",
                    title: hs.lang.loadingTitle,
                    innerHTML: hs.lang.loadingText,
                    href: "javascript:;"
                }, {
                    position: "absolute",
                    top: "-9999px",
                    opacity: hs.loadingOpacity,
                    zIndex: 1
                }, hs.container);
                hs.garbageBin = hs.createElement("div", null, {
                    display: "none"
                }, hs.container);
                Math.linearTween = function (g, b, e, f) {
                    return e * g / f + b
                };
                Math.easeInQuad = function (g, b, e, f) {
                    return e * (g /= f) * g + b
                };
                hs.hideSelects = hs.ieLt7;
                hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == "KDE" || (hs.ieLt7 && hs.uaVersion < 5.5))
            }
        },
        ready: function () {
            if (hs.isReady) {
                return
            }
            hs.isReady = true;
            for (var a = 0; a < hs.onReady.length; a++) {
                hs.onReady[a]()
            }
        },
        updateAnchors: function () {
            var b, c, a = [],
				h = [],
				e = {},
				l;
            for (var f = 0; f < hs.openerTagNames.length; f++) {
                c = document.getElementsByTagName(hs.openerTagNames[f]);
                for (var k = 0; k < c.length; k++) {
                    b = c[k];
                    l = hs.isHsAnchor(b);
                    if (l) {
                        hs.push(a, b);
                        if (l[0] == "hs.expand") {
                            hs.push(h, b)
                        }
                        var d = hs.getParam(b, "slideshowGroup") || "none";
                        if (!e[d]) {
                            e[d] = []
                        }
                        hs.push(e[d], b)
                    }
                }
            }
            hs.anchors = {
                all: a,
                groups: e,
                images: h
            };
            return hs.anchors
        },
        getAnchors: function () {
            return hs.anchors || hs.updateAnchors()
        },
        close: function (a) {
            var b = hs.getExpander(a);
            if (b) {
                b.close()
            }
            return false
        }
    };
    hs.fx = function (a, b, c) {
        this.options = b;
        this.elem = a;
        this.prop = c;
        if (!b.orig) {
            b.orig = {}
        }
    };
    hs.fx.prototype = {
        update: function () {
            (hs.fx.step[this.prop] || hs.fx.step._default)(this);
            if (this.options.step) {
                this.options.step.call(this.elem, this.now, this)
            }
        },
        custom: function (a, d, e) {
            this.startTime = (new Date()).getTime();
            this.start = a;
            this.end = d;
            this.unit = e;
            this.now = this.start;
            this.pos = this.state = 0;
            var b = this;

            function c(f) {
                return b.step(f)
            }
            c.elem = this.elem;
            if (c() && hs.timers.push(c) == 1) {
                hs.timerId = setInterval(function () {
                    var g = hs.timers;
                    for (var f = 0; f < g.length; f++) {
                        if (!g[f]()) {
                            g.splice(f--, 1)
                        }
                    }
                    if (!g.length) {
                        clearInterval(hs.timerId)
                    }
                }, 13)
            }
        },
        step: function (b) {
            var e = (new Date()).getTime();
            if (b || e >= this.options.duration + this.startTime) {
                this.now = this.end;
                this.pos = this.state = 1;
                this.update();
                this.options.curAnim[this.prop] = true;
                var a = true;
                for (var c in this.options.curAnim) {
                    if (this.options.curAnim[c] !== true) {
                        a = false
                    }
                }
                if (a) {
                    if (this.options.complete) {
                        this.options.complete.call(this.elem)
                    }
                }
                return false
            } else {
                var d = e - this.startTime;
                this.state = d / this.options.duration;
                this.pos = this.options.easing(d, 0, 1, this.options.duration);
                this.now = this.start + ((this.end - this.start) * this.pos);
                this.update()
            }
            return true
        }
    };
    hs.extend(hs.fx, {
        step: {
            opacity: function (a) {
                hs.setStyles(a.elem, {
                    opacity: a.now
                })
            },
            _default: function (b) {
                try {
                    if (b.elem.style && b.elem.style[b.prop] != null) {
                        b.elem.style[b.prop] = b.now + b.unit
                    } else {
                        b.elem[b.prop] = b.now
                    }
                } catch (a) { }
            }
        }
    });
    hs.Outline = function (c, b) {
        this.onLoad = b;
        this.outlineType = c;
        var g = hs.uaVersion,
			f;
        this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7;
        if (!c) {
            if (b) {
                b()
            }
            return
        }
        hs.init();
        this.table = hs.createElement("table", {
            cellSpacing: 0
        }, {
            visibility: "hidden",
            position: "absolute",
            borderCollapse: "collapse",
            width: 0
        }, hs.container, true);
        var e = hs.createElement("tbody", null, null, this.table, 1);
        this.td = [];
        for (var a = 0; a <= 8; a++) {
            if (a % 3 == 0) {
                f = hs.createElement("tr", null, {
                    height: "auto"
                }, e, true)
            }
            this.td[a] = hs.createElement("td", null, null, f, true);
            var d = a != 4 ? {
                lineHeight: 0,
                fontSize: 0
            } : {
                position: "relative"
            };
            hs.setStyles(this.td[a], d)
        }
        this.td[4].className = c + " highslide-outline";
        this.preloadGraphic()
    };
    hs.Outline.prototype = {
        preloadGraphic: function () {
            var c = hs.graphicsDir + (hs.outlinesDir || "outlines/") + this.outlineType + ".png";
            var a = hs.safari && hs.uaVersion < 525 ? hs.container : null;
            this.graphic = hs.createElement("img", null, {
                position: "absolute",
                top: "-9999px"
            }, a, true);
            var b = this;
            this.graphic.onload = function () {
                b.onGraphicLoad()
            };
            this.graphic.src = c
        },
        onGraphicLoad: function () {
            var d = this.offset = this.graphic.width / 4,
				e = [
					[0, 0],
					[0, -4],
					[-2, 0],
					[0, -8], 0, [-2, -8],
					[0, -2],
					[0, -6],
					[-2, -2]
				],
				a = {
				    height: (2 * d) + "px",
				    width: (2 * d) + "px"
				};
            for (var c = 0; c <= 8; c++) {
                if (e[c]) {
                    if (this.hasAlphaImageLoader) {
                        var f = (c == 1 || c == 7) ? "100%" : this.graphic.width + "px";
                        var b = hs.createElement("div", null, {
                            width: "100%",
                            height: "100%",
                            position: "relative",
                            overflow: "hidden"
                        }, this.td[c], true);
                        hs.createElement("div", null, {
                            filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='" + this.graphic.src + "')",
                            position: "absolute",
                            width: f,
                            height: this.graphic.height + "px",
                            left: (e[c][0] * d) + "px",
                            top: (e[c][1] * d) + "px"
                        }, b, true)
                    } else {
                        hs.setStyles(this.td[c], {
                            background: "url(" + this.graphic.src + ") " + (e[c][0] * d) + "px " + (e[c][1] * d) + "px"
                        })
                    }
                    if (window.opera && (c == 3 || c == 5)) {
                        hs.createElement("div", null, a, this.td[c], true)
                    }
                    hs.setStyles(this.td[c], a)
                }
            }
            this.graphic = null;
            if (hs.pendingOutlines[this.outlineType]) {
                hs.pendingOutlines[this.outlineType].destroy()
            }
            hs.pendingOutlines[this.outlineType] = this;
            if (this.onLoad) {
                this.onLoad()
            }
        },
        setPosition: function (e, d, g, a, b) {
            var c = this.exp,
				f = c.wrapper.style,
				d = d || 0,
				e = e || {
				    x: c.x.pos + d,
				    y: c.y.pos + d,
				    w: c.x.get("wsize") - 2 * d,
				    h: c.y.get("wsize") - 2 * d
				};
            if (g) {
                this.table.style.visibility = (e.h >= 4 * this.offset) ? "visible" : "hidden"
            }
            hs.setStyles(this.table, {
                left: (e.x - this.offset) + "px",
                top: (e.y - this.offset) + "px",
                width: (e.w + 2 * this.offset) + "px"
            });
            e.w -= 2 * this.offset;
            e.h -= 2 * this.offset;
            hs.setStyles(this.td[4], {
                width: e.w >= 0 ? e.w + "px" : 0,
                height: e.h >= 0 ? e.h + "px" : 0
            });
            if (this.hasAlphaImageLoader) {
                this.td[3].style.height = this.td[5].style.height = this.td[4].style.height
            }
        },
        destroy: function (a) {
            if (a) {
                this.table.style.visibility = "hidden"
            } else {
                hs.discardElement(this.table)
            }
        }
    };
    hs.Dimension = function (b, a) {
        this.exp = b;
        this.dim = a;
        this.ucwh = a == "x" ? "Width" : "Height";
        this.wh = this.ucwh.toLowerCase();
        this.uclt = a == "x" ? "Left" : "Top";
        this.lt = this.uclt.toLowerCase();
        this.ucrb = a == "x" ? "Right" : "Bottom";
        this.rb = this.ucrb.toLowerCase();
        this.p1 = this.p2 = 0
    };
    hs.Dimension.prototype = {
        get: function (a) {
            switch (a) {
                case "loadingPos":
                    return this.tpos + this.tb + (this.t - hs.loading["offset" + this.ucwh]) / 2;
                case "wsize":
                    return this.size + 2 * this.cb + this.p1 + this.p2;
                case "fitsize":
                    return this.clientSize - this.marginMin - this.marginMax;
                case "maxsize":
                    return this.get("fitsize") - 2 * this.cb - this.p1 - this.p2;
                case "opos":
                    return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
                case "osize":
                    return this.get("wsize") + (this.exp.outline ? 2 * this.exp.outline.offset : 0);
                case "imgPad":
                    return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0
            }
        },
        calcBorders: function () {
            this.cb = (this.exp.content["offset" + this.ucwh] - this.t) / 2;
            this.marginMax = hs["margin" + this.ucrb]
        },
        calcThumb: function () {
            this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : this.exp.el["offset" + this.ucwh];
            this.tpos = this.exp.tpos[this.dim];
            this.tb = (this.exp.el["offset" + this.ucwh] - this.t) / 2;
            if (this.tpos == 0 || this.tpos == -1) {
                this.tpos = (hs.page[this.wh] / 2) + hs.page["scroll" + this.uclt]
            }
        },
        calcExpanded: function () {
            var a = this.exp;
            this.justify = "auto";
            this.pos = this.tpos - this.cb + this.tb;
            if (this.maxHeight && this.dim == "x") {
                a.maxWidth = Math.min(a.maxWidth || this.full, a.maxHeight * this.full / a.y.full)
            }
            this.size = Math.min(this.full, a["max" + this.ucwh] || this.full);
            this.minSize = a.allowSizeReduction ? Math.min(a["min" + this.ucwh], this.full) : this.full;
            if (a.isImage && a.useBox) {
                this.size = a[this.wh];
                this.imgSize = this.full
            }
            if (this.dim == "x" && hs.padToMinWidth) {
                this.minSize = a.minWidth
            }
            this.marginMin = hs["margin" + this.uclt];
            this.scroll = hs.page["scroll" + this.uclt];
            this.clientSize = hs.page[this.wh]
        },
        setSize: function (b) {
            var a = this.exp;
            if (a.isImage && (a.useBox || hs.padToMinWidth)) {
                this.imgSize = b;
                this.size = Math.max(this.size, this.imgSize);
                a.content.style[this.lt] = this.get("imgPad") + "px"
            } else {
                this.size = b
            }
            a.content.style[this.wh] = b + "px";
            a.wrapper.style[this.wh] = this.get("wsize") + "px";
            if (a.outline) {
                a.outline.setPosition()
            }
            if (this.dim == "x" && a.overlayBox) {
                a.sizeOverlayBox(true)
            }
        },
        setPos: function (a) {
            this.pos = a;
            this.exp.wrapper.style[this.lt] = a + "px";
            if (this.exp.outline) {
                this.exp.outline.setPosition()
            }
        }
    };
    hs.Expander = function (b, k, d, c) {
        if (document.readyState && hs.ie && !hs.isReady) {
            hs.addEventListener(document, "ready", function () {
                new hs.Expander(b, k, d, c)
            });
            return
        }
        this.a = b;
        this.custom = d;
        this.contentType = c || "image";
        this.isImage = !this.isHtml;
        hs.continuePreloading = false;
        this.overlays = [];
        hs.init();
        var h = this.key = hs.expanders.length;
        for (var g = 0; g < hs.overrides.length; g++) {
            var j = hs.overrides[g];
            this[j] = k && typeof k[j] != "undefined" ? k[j] : hs[j]
        }
        if (!this.src) {
            this.src = b.href
        }
        var e = (k && k.thumbnailId) ? hs.$(k.thumbnailId) : b;
        e = this.thumb = e.getElementsByTagName("img")[0] || e;
        this.thumbsUserSetId = e.id || b.id;
        for (var g = 0; g < hs.expanders.length; g++) {
            if (hs.expanders[g] && hs.expanders[g].a == b) {
                hs.expanders[g].focus();
                return false
            }
        }
        if (!hs.allowSimultaneousLoading) {
            for (var g = 0; g < hs.expanders.length; g++) {
                if (hs.expanders[g] && hs.expanders[g].thumb != e && !hs.expanders[g].onLoadStarted) {
                    hs.expanders[g].cancelLoading()
                }
            }
        }
        hs.expanders[h] = this;
        if (!hs.allowMultipleInstances && !hs.upcoming) {
            if (hs.expanders[h - 1]) {
                hs.expanders[h - 1].close()
            }
            if (typeof hs.focusKey != "undefined" && hs.expanders[hs.focusKey]) {
                hs.expanders[hs.focusKey].close()
            }
        }
        this.el = e;
        this.tpos = this.pageOrigin || hs.getPosition(e);
        hs.getPageSize();
        var l = this.x = new hs.Dimension(this, "x");
        l.calcThumb();
        var m = this.y = new hs.Dimension(this, "y");
        m.calcThumb();
        this.wrapper = hs.createElement("div", {
            id: "highslide-wrapper-" + this.key,
            className: "highslide-wrapper " + this.wrapperClassName
        }, {
            visibility: "hidden",
            position: "absolute",
            zIndex: hs.zIndexCounter += 2
        }, null, true);
        this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
        if (this.contentType == "image" && this.outlineWhileAnimating == 2) {
            this.outlineWhileAnimating = 0
        }
        if (!this.outlineType) {
            this[this.contentType + "Create"]()
        } else {
            if (hs.pendingOutlines[this.outlineType]) {
                this.connectOutline();
                this[this.contentType + "Create"]()
            } else {
                this.showLoading();
                var f = this;
                new hs.Outline(this.outlineType, function () {
                    f.connectOutline();
                    f[f.contentType + "Create"]()
                })
            }
        }
        return true
    };
    hs.Expander.prototype = {
        error: function (a) {
            if (hs.debug) {
                alert("Line " + a.lineNumber + ": " + a.message)
            } else {
                window.location.href = this.src
            }
        },
        connectOutline: function () {
            var a = this.outline = hs.pendingOutlines[this.outlineType];
            a.exp = this;
            a.table.style.zIndex = this.wrapper.style.zIndex - 1;
            hs.pendingOutlines[this.outlineType] = null
        },
        showLoading: function () {
            if (this.onLoadStarted || this.loading) {
                return
            }
            this.loading = hs.loading;
            var a = this;
            this.loading.onclick = function () {
                a.cancelLoading()
            };
            var a = this,
				b = this.x.get("loadingPos") + "px",
				c = this.y.get("loadingPos") + "px";
            setTimeout(function () {
                if (a.loading) {
                    hs.setStyles(a.loading, {
                        left: b,
                        top: c,
                        zIndex: hs.zIndexCounter++
                    })
                }
            }, 100)
        },
        imageCreate: function () {
            var a = this;
            var b = document.createElement("img");
            this.content = b;
            b.onload = function () {
                if (hs.expanders[a.key]) {
                    a.contentLoaded()
                }
            };
            if (hs.blockRightClick) {
                b.oncontextmenu = function () {
                    return false
                }
            }
            b.className = "highslide-image";
            hs.setStyles(b, {
                visibility: "hidden",
                display: "block",
                position: "absolute",
                maxWidth: "9999px",
                zIndex: 3
            });
            b.title = hs.lang.restoreTitle;
            if (hs.safari && hs.uaVersion < 525) {
                hs.container.appendChild(b)
            }
            if (hs.ie && hs.flushImgSize) {
                b.src = null
            }
            b.src = this.src;
            this.showLoading()
        },
        contentLoaded: function () {
            try {
                if (!this.content) {
                    return
                }
                this.content.onload = null;
                if (this.onLoadStarted) {
                    return
                } else {
                    this.onLoadStarted = true
                }
                var c = this.x,
					d = this.y;
                if (this.loading) {
                    hs.setStyles(this.loading, {
                        top: "-9999px"
                    });
                    this.loading = null
                }
                c.full = this.content.width;
                d.full = this.content.height;
                hs.setStyles(this.content, {
                    width: c.t + "px",
                    height: d.t + "px"
                });
                this.wrapper.appendChild(this.content);
                hs.container.appendChild(this.wrapper);
                c.calcBorders();
                d.calcBorders();
                hs.setStyles(this.wrapper, {
                    left: (c.tpos + c.tb - c.cb) + "px",
                    top: (d.tpos + c.tb - d.cb) + "px"
                });
                this.getOverlays();
                var b = c.full / d.full;
                c.calcExpanded();
                this.justify(c);
                d.calcExpanded();
                this.justify(d);
                if (this.overlayBox) {
                    this.sizeOverlayBox(0, 1)
                }
                if (this.allowSizeReduction) {
                    this.correctRatio(b);
                    if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
                        this.createFullExpand();
                        if (this.overlays.length == 1) {
                            this.sizeOverlayBox()
                        }
                    }
                }
                this.show()
            } catch (a) {
                this.error(a)
            }
        },
        justify: function (e, d) {
            var g, f = e.target,
				b = e == this.x ? "x" : "y";
            var c = false;
            var a = e.exp.allowSizeReduction;
            e.pos = Math.round(e.pos - ((e.get("wsize") - e.t) / 2));
            if (e.pos < e.scroll + e.marginMin) {
                e.pos = e.scroll + e.marginMin;
                c = true
            }
            if (!d && e.size < e.minSize) {
                e.size = e.minSize;
                a = false
            }
            if (e.pos + e.get("wsize") > e.scroll + e.clientSize - e.marginMax) {
                if (!d && c && a) {
                    e.size = Math.min(e.size, e.get(b == "y" ? "fitsize" : "maxsize"))
                } else {
                    if (e.get("wsize") < e.get("fitsize")) {
                        e.pos = e.scroll + e.clientSize - e.marginMax - e.get("wsize")
                    } else {
                        e.pos = e.scroll + e.marginMin;
                        if (!d && a) {
                            e.size = e.get(b == "y" ? "fitsize" : "maxsize")
                        }
                    }
                }
            }
            if (!d && e.size < e.minSize) {
                e.size = e.minSize;
                a = false
            }
            if (e.pos < e.marginMin) {
                var h = e.pos;
                e.pos = e.marginMin;
                if (a && !d) {
                    e.size = e.size - (e.pos - h)
                }
            }
        },
        correctRatio: function (b) {
            var d = this.x,
				f = this.y,
				a = false,
				e = Math.min(d.full, d.size),
				g = Math.min(f.full, f.size),
				c = (this.useBox || hs.padToMinWidth);
            if (e / g > b) {
                e = g * b;
                if (e < d.minSize) {
                    e = d.minSize;
                    g = e / b
                }
                a = true
            } else {
                if (e / g < b) {
                    g = e / b;
                    a = true
                }
            }
            if (hs.padToMinWidth && d.full < d.minSize) {
                d.imgSize = d.full;
                f.size = f.imgSize = f.full
            } else {
                if (this.useBox) {
                    d.imgSize = e;
                    f.imgSize = g
                } else {
                    d.size = e;
                    f.size = g
                }
            }
            a = this.fitOverlayBox(this.useBox ? null : b, a);
            if (c && f.size < f.imgSize) {
                f.imgSize = f.size;
                d.imgSize = f.size * b
            }
            if (a || c) {
                d.pos = d.tpos - d.cb + d.tb;
                d.minSize = d.size;
                this.justify(d, true);
                f.pos = f.tpos - f.cb + f.tb;
                f.minSize = f.size;
                this.justify(f, true);
                if (this.overlayBox) {
                    this.sizeOverlayBox()
                }
            }
        },
        fitOverlayBox: function (b, a) {
            var c = this.x,
				d = this.y;
            if (this.overlayBox) {
                while (d.size > this.minHeight && c.size > this.minWidth && d.get("wsize") > d.get("fitsize")) {
                    d.size -= 10;
                    if (b) {
                        c.size = d.size * b
                    }
                    this.sizeOverlayBox(0, 1);
                    a = true
                }
            }
            return a
        },
        show: function () {
            var a = this.x,
				b = this.y;
            this.doShowHide("hidden");
            this.changeSize(1, {
                wrapper: {
                    width: a.get("wsize"),
                    height: b.get("wsize"),
                    left: a.pos,
                    top: b.pos
                },
                content: {
                    left: a.p1 + a.get("imgPad"),
                    top: b.p1 + b.get("imgPad"),
                    width: a.imgSize || a.size,
                    height: b.imgSize || b.size
                }
            }, hs.expandDuration)
        },
        changeSize: function (f, e, b) {
            if (this.outline && !this.outlineWhileAnimating) {
                if (f) {
                    this.outline.setPosition()
                } else {
                    this.outline.destroy()
                }
            }
            if (!f) {
                this.destroyOverlays()
            }
            var d = this,
				g = d.x,
				h = d.y,
				c = this.easing;
            if (!f) {
                c = this.easingClose || c
            }
            var a = f ?
			function () {
			    if (d.outline) {
			        d.outline.table.style.visibility = "visible"
			    }
			    setTimeout(function () {
			        d.afterExpand()
			    }, 50)
			} : function () {
			    d.afterClose()
			};
            if (f) {
                hs.setStyles(this.wrapper, {
                    width: g.t + "px",
                    height: h.t + "px"
                })
            }
            if (this.fadeInOut) {
                hs.setStyles(this.wrapper, {
                    opacity: f ? 0 : 1
                });
                hs.extend(e.wrapper, {
                    opacity: f
                })
            }
            hs.animate(this.wrapper, e.wrapper, {
                duration: b,
                easing: c,
                step: function (l, i) {
                    if (d.outline && d.outlineWhileAnimating && i.prop == "top") {
                        var j = f ? i.pos : 1 - i.pos;
                        var k = {
                            w: g.t + (g.get("wsize") - g.t) * j,
                            h: h.t + (h.get("wsize") - h.t) * j,
                            x: g.tpos + (g.pos - g.tpos) * j,
                            y: h.tpos + (h.pos - h.tpos) * j
                        };
                        d.outline.setPosition(k, 0, 1)
                    }
                }
            });
            hs.animate(this.content, e.content, b, c, a);
            if (f) {
                this.wrapper.style.visibility = "visible";
                this.content.style.visibility = "visible";
                this.a.className += " highslide-active-anchor"
            }
        },
        afterExpand: function () {
            this.isExpanded = true;
            this.focus();
            if (hs.upcoming && hs.upcoming == this.a) {
                hs.upcoming = null
            }
            this.prepareNextOutline();
            var c = hs.page,
				a = hs.mouse.x + c.scrollLeft,
				b = hs.mouse.y + c.scrollTop;
            this.mouseIsOver = this.x.pos < a && a < this.x.pos + this.x.get("wsize") && this.y.pos < b && b < this.y.pos + this.y.get("wsize");
            if (this.overlayBox) {
                this.showOverlays()
            }
        },
        prepareNextOutline: function () {
            var a = this.key;
            var b = this.outlineType;
            new hs.Outline(b, function () {
                try {
                    hs.expanders[a].preloadNext()
                } catch (c) { }
            })
        },
        preloadNext: function () {
            var b = this.getAdjacentAnchor(1);
            if (b && b.onclick.toString().match(/hs\.expand/)) {
                var a = hs.createElement("img", {
                    src: hs.getSrc(b)
                })
            }
        },
        getAdjacentAnchor: function (c) {
            var b = this.getAnchorIndex(),
				a = hs.anchors.groups[this.slideshowGroup || "none"];
            return (a && a[b + c]) || null
        },
        getAnchorIndex: function () {
            var a = hs.getAnchors().groups[this.slideshowGroup || "none"];
            if (a) {
                for (var b = 0; b < a.length; b++) {
                    if (a[b] == this.a) {
                        return b
                    }
                }
            }
            return null
        },
        cancelLoading: function () {
            hs.discardElement(this.wrapper);
            hs.expanders[this.key] = null;
            if (this.loading) {
                hs.loading.style.left = "-9999px"
            }
        },
        writeCredits: function () {
            this.credits = hs.createElement("a", {
                href: hs.creditsHref,
                target: hs.creditsTarget,
                className: "highslide-credits",
                innerHTML: hs.lang.creditsText,
                title: hs.lang.creditsTitle
            });
            this.createOverlay({
                overlayId: this.credits,
                position: this.creditsPosition || "top left"
            })
        },
        getInline: function (types, addOverlay) {
            for (var i = 0; i < types.length; i++) {
                var type = types[i],
					s = null;
                if (!this[type + "Id"] && this.thumbsUserSetId) {
                    this[type + "Id"] = type + "-for-" + this.thumbsUserSetId
                }
                if (this[type + "Id"]) {
                    this[type] = hs.getNode(this[type + "Id"])
                }
                if (!this[type] && !this[type + "Text"] && this[type + "Eval"]) {
                    try {
                        s = eval(this[type + "Eval"])
                    } catch (e) { }
                }
                if (!this[type] && this[type + "Text"]) {
                    s = this[type + "Text"]
                }
                if (!this[type] && !s) {
                    this[type] = hs.getNode(this.a["_" + type + "Id"]);
                    if (!this[type]) {
                        var next = this.a.nextSibling;
                        while (next && !hs.isHsAnchor(next)) {
                            if ((new RegExp("highslide-" + type)).test(next.className || null)) {
                                if (!next.id) {
                                    this.a["_" + type + "Id"] = next.id = "hsId" + hs.idCounter++
                                }
                                this[type] = hs.getNode(next.id);
                                break
                            }
                            next = next.nextSibling
                        }
                    }
                }
                if (!this[type] && s) {
                    this[type] = hs.createElement("div", {
                        className: "highslide-" + type,
                        innerHTML: s
                    })
                }
                if (addOverlay && this[type]) {
                    var o = {
                        position: (type == "heading") ? "above" : "below"
                    };
                    for (var x in this[type + "Overlay"]) {
                        o[x] = this[type + "Overlay"][x]
                    }
                    o.overlayId = this[type];
                    this.createOverlay(o)
                }
            }
        },
        doShowHide: function (a) {
            if (hs.hideSelects) {
                this.showHideElements("SELECT", a)
            }
            if (hs.hideIframes) {
                this.showHideElements("IFRAME", a)
            }
            if (hs.geckoMac) {
                this.showHideElements("*", a)
            }
        },
        showHideElements: function (h, j) {
            var d = document.getElementsByTagName(h);
            var g = h == "*" ? "overflow" : "visibility";
            for (var f = 0; f < d.length; f++) {
                if (g == "visibility" || (document.defaultView.getComputedStyle(d[f], "").getPropertyValue("overflow") == "auto" || d[f].getAttribute("hidden-by") != null)) {
                    var e = d[f].getAttribute("hidden-by");
                    if (j == "visible" && e) {
                        e = e.replace("[" + this.key + "]", "");
                        d[f].setAttribute("hidden-by", e);
                        if (!e) {
                            d[f].style[g] = d[f].origProp
                        }
                    } else {
                        if (j == "hidden") {
                            var c = hs.getPosition(d[f]);
                            c.w = d[f].offsetWidth;
                            c.h = d[f].offsetHeight;
                            var a = (c.x + c.w < this.x.get("opos") || c.x > this.x.get("opos") + this.x.get("osize"));
                            var b = (c.y + c.h < this.y.get("opos") || c.y > this.y.get("opos") + this.y.get("osize"));
                            var k = hs.getWrapperKey(d[f]);
                            if (!a && !b && k != this.key) {
                                if (!e) {
                                    d[f].setAttribute("hidden-by", "[" + this.key + "]");
                                    d[f].origProp = d[f].style[g];
                                    d[f].style[g] = "hidden"
                                } else {
                                    if (e.indexOf("[" + this.key + "]") == -1) {
                                        d[f].setAttribute("hidden-by", e + "[" + this.key + "]")
                                    }
                                }
                            } else {
                                if ((e == "[" + this.key + "]" || hs.focusKey == k) && k != this.key) {
                                    d[f].setAttribute("hidden-by", "");
                                    d[f].style[g] = d[f].origProp || ""
                                } else {
                                    if (e && e.indexOf("[" + this.key + "]") > -1) {
                                        d[f].setAttribute("hidden-by", e.replace("[" + this.key + "]", ""))
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        focus: function () {
            this.wrapper.style.zIndex = hs.zIndexCounter += 2;
            for (var b = 0; b < hs.expanders.length; b++) {
                if (hs.expanders[b] && b == hs.focusKey) {
                    var a = hs.expanders[b];
                    a.content.className += " highslide-" + a.contentType + "-blur";
                    a.content.style.cursor = hs.ieLt7 ? "hand" : "pointer";
                    a.content.title = hs.lang.focusTitle
                }
            }
            if (this.outline) {
                this.outline.table.style.zIndex = this.wrapper.style.zIndex - 1
            }
            this.content.className = "highslide-" + this.contentType;
            this.content.title = hs.lang.restoreTitle;
            if (hs.restoreCursor) {
                hs.styleRestoreCursor = window.opera ? "pointer" : "url(" + hs.graphicsDir + hs.restoreCursor + "), pointer";
                if (hs.ieLt7 && hs.uaVersion < 6) {
                    hs.styleRestoreCursor = "hand"
                }
                this.content.style.cursor = hs.styleRestoreCursor
            }
            hs.focusKey = this.key;
            hs.addEventListener(document, window.opera ? "keypress" : "keydown", hs.keyHandler)
        },
        moveTo: function (a, b) {
            this.x.setPos(a);
            this.y.setPos(b)
        },
        resize: function (a) {
            var d, b, c = a.width / a.height;
            d = Math.max(a.width + a.dX, Math.min(this.minWidth, this.x.full));
            if (this.isImage && Math.abs(d - this.x.full) < 12) {
                d = this.x.full
            }
            b = d / c;
            if (b < Math.min(this.minHeight, this.y.full)) {
                b = Math.min(this.minHeight, this.y.full);
                if (this.isImage) {
                    d = b * c
                }
            }
            this.resizeTo(d, b)
        },
        resizeTo: function (b, a) {
            this.y.setSize(a);
            this.x.setSize(b);
            this.wrapper.style.height = this.y.get("wsize") + "px"
        },
        close: function () {
            if (this.isClosing || !this.isExpanded) {
                return
            }
            this.isClosing = true;
            hs.removeEventListener(document, window.opera ? "keypress" : "keydown", hs.keyHandler);
            try {
                this.content.style.cursor = "default";
                this.changeSize(0, {
                    wrapper: {
                        width: this.x.t,
                        height: this.y.t,
                        left: this.x.tpos - this.x.cb + this.x.tb,
                        top: this.y.tpos - this.y.cb + this.y.tb
                    },
                    content: {
                        left: 0,
                        top: 0,
                        width: this.x.t,
                        height: this.y.t
                    }
                }, hs.restoreDuration)
            } catch (a) {
                this.afterClose()
            }
        },
        createOverlay: function (b) {
            var a = b.overlayId;
            if (typeof a == "string") {
                a = hs.getNode(a)
            }
            if (b.html) {
                a = hs.createElement("div", {
                    innerHTML: b.html
                })
            }
            if (!a || typeof a == "string") {
                return
            }
            a.style.display = "block";
            this.genOverlayBox();
            var d = b.width && /^[0-9]+(px|%)$/.test(b.width) ? b.width : "auto";
            if (/^(left|right)panel$/.test(b.position) && !/^[0-9]+px$/.test(b.width)) {
                d = "200px"
            }
            var c = hs.createElement("div", {
                id: "hsId" + hs.idCounter++,
                hsId: b.hsId
            }, {
                position: "absolute",
                visibility: "hidden",
                width: d,
                direction: hs.lang.cssDirection || "",
                opacity: 0
            }, this.overlayBox, true);
            c.appendChild(a);
            hs.extend(c, {
                opacity: 1,
                offsetX: 0,
                offsetY: 0,
                dur: (b.fade === 0 || b.fade === false || (b.fade == 2 && hs.ie)) ? 0 : 250
            });
            hs.extend(c, b);
            if (this.gotOverlays) {
                this.positionOverlay(c);
                if (!c.hideOnMouseOut || this.mouseIsOver) {
                    hs.animate(c, {
                        opacity: c.opacity
                    }, c.dur)
                }
            }
            hs.push(this.overlays, hs.idCounter - 1)
        },
        positionOverlay: function (c) {
            var d = c.position || "middle center",
				a = c.offsetX,
				b = c.offsetY;
            if (c.parentNode != this.overlayBox) {
                this.overlayBox.appendChild(c)
            }
            if (/left$/.test(d)) {
                c.style.left = a + "px"
            }
            if (/center$/.test(d)) {
                hs.setStyles(c, {
                    left: "50%",
                    marginLeft: (a - Math.round(c.offsetWidth / 2)) + "px"
                })
            }
            if (/right$/.test(d)) {
                c.style.right = -a + "px"
            }
            if (/^leftpanel$/.test(d)) {
                hs.setStyles(c, {
                    right: "100%",
                    marginRight: this.x.cb + "px",
                    top: -this.y.cb + "px",
                    bottom: -this.y.cb + "px",
                    overflow: "auto"
                });
                this.x.p1 = c.offsetWidth
            } else {
                if (/^rightpanel$/.test(d)) {
                    hs.setStyles(c, {
                        left: "100%",
                        marginLeft: this.x.cb + "px",
                        top: -this.y.cb + "px",
                        bottom: -this.y.cb + "px",
                        overflow: "auto"
                    });
                    this.x.p2 = c.offsetWidth
                }
            }
            if (/^top/.test(d)) {
                c.style.top = b + "px"
            }
            if (/^middle/.test(d)) {
                hs.setStyles(c, {
                    top: "50%",
                    marginTop: (b - Math.round(c.offsetHeight / 2)) + "px"
                })
            }
            if (/^bottom/.test(d)) {
                c.style.bottom = -b + "px"
            }
            if (/^above$/.test(d)) {
                hs.setStyles(c, {
                    left: (-this.x.p1 - this.x.cb) + "px",
                    right: (-this.x.p2 - this.x.cb) + "px",
                    bottom: "100%",
                    marginBottom: this.y.cb + "px",
                    width: "auto"
                });
                this.y.p1 = c.offsetHeight
            } else {
                if (/^below$/.test(d)) {
                    hs.setStyles(c, {
                        position: "relative",
                        left: (-this.x.p1 - this.x.cb) + "px",
                        right: (-this.x.p2 - this.x.cb) + "px",
                        top: "100%",
                        marginTop: this.y.cb + "px",
                        width: "auto"
                    });
                    this.y.p2 = c.offsetHeight;
                    c.style.position = "absolute"
                }
            }
        },
        getOverlays: function () {
            this.getInline(["heading", "caption"], true);
            if (this.heading && this.dragByHeading) {
                this.heading.className += " highslide-move"
            }
            if (hs.showCredits) {
                this.writeCredits()
            }
            for (var a = 0; a < hs.overlays.length; a++) {
                var b = hs.overlays[a],
					e = b.thumbnailId,
					d = b.slideshowGroup;
                if ((!e && !d) || (e && e == this.thumbsUserSetId) || (d && d === this.slideshowGroup)) {
                    this.createOverlay(b)
                }
            }
            var c = [];
            for (var a = 0; a < this.overlays.length; a++) {
                var b = hs.$("hsId" + this.overlays[a]);
                if (/panel$/.test(b.position)) {
                    this.positionOverlay(b)
                } else {
                    hs.push(c, b)
                }
            }
            for (var a = 0; a < c.length; a++) {
                this.positionOverlay(c[a])
            }
            this.gotOverlays = true
        },
        genOverlayBox: function () {
            if (!this.overlayBox) {
                this.overlayBox = hs.createElement("div", {
                    className: this.wrapperClassName
                }, {
                    position: "absolute",
                    width: (this.x.size || (this.useBox ? this.width : null) || this.x.full) + "px",
                    height: (this.y.size || this.y.full) + "px",
                    visibility: "hidden",
                    overflow: "hidden",
                    zIndex: hs.ie ? 4 : "auto"
                }, hs.container, true)
            }
        },
        sizeOverlayBox: function (b, a) {
            var f = this.overlayBox,
				g = this.x,
				h = this.y;
            hs.setStyles(f, {
                width: g.size + "px",
                height: h.size + "px"
            });
            if (b || a) {
                for (var c = 0; c < this.overlays.length; c++) {
                    var e = hs.$("hsId" + this.overlays[c]);
                    var d = (hs.ieLt7 || document.compatMode == "BackCompat");
                    if (e && /^(above|below)$/.test(e.position)) {
                        if (d) {
                            e.style.width = (f.offsetWidth + 2 * g.cb + g.p1 + g.p2) + "px"
                        }
                        h[e.position == "above" ? "p1" : "p2"] = e.offsetHeight
                    }
                    if (e && d && /^(left|right)panel$/.test(e.position)) {
                        e.style.height = (f.offsetHeight + 2 * h.cb) + "px"
                    }
                }
            }
            if (b) {
                hs.setStyles(this.content, {
                    top: h.p1 + "px"
                });
                hs.setStyles(f, {
                    top: (h.p1 + h.cb) + "px"
                })
            }
        },
        showOverlays: function () {
            var a = this.overlayBox;
            a.className = "";
            hs.setStyles(a, {
                top: (this.y.p1 + this.y.cb) + "px",
                left: (this.x.p1 + this.x.cb) + "px",
                overflow: "visible"
            });
            if (hs.safari) {
                a.style.visibility = "visible"
            }
            this.wrapper.appendChild(a);
            for (var c = 0; c < this.overlays.length; c++) {
                var d = hs.$("hsId" + this.overlays[c]);
                d.style.zIndex = d.zIndex || 4;
                if (!d.hideOnMouseOut || this.mouseIsOver) {
                    d.style.visibility = "visible";
                    hs.setStyles(d, {
                        visibility: "visible",
                        display: ""
                    });
                    hs.animate(d, {
                        opacity: d.opacity
                    }, d.dur)
                }
            }
        },
        destroyOverlays: function () {
            if (!this.overlays.length) {
                return
            }
            hs.discardElement(this.overlayBox)
        },
        createFullExpand: function () {
            this.fullExpandLabel = hs.createElement("a", {
                href: "javascript:hs.expanders[" + this.key + "].doFullExpand();",
                title: hs.lang.fullExpandTitle,
                className: "highslide-full-expand"
            });
            this.createOverlay({
                overlayId: this.fullExpandLabel,
                position: hs.fullExpandPosition,
                hideOnMouseOut: true,
                opacity: hs.fullExpandOpacity
            })
        },
        doFullExpand: function () {
            try {
                if (this.fullExpandLabel) {
                    hs.discardElement(this.fullExpandLabel)
                }
                this.focus();
                var c = this.x.size;
                this.resizeTo(this.x.full, this.y.full);
                var b = this.x.pos - (this.x.size - c) / 2;
                if (b < hs.marginLeft) {
                    b = hs.marginLeft
                }
                this.moveTo(b, this.y.pos);
                this.doShowHide("hidden")
            } catch (a) {
                this.error(a)
            }
        },
        afterClose: function () {
            this.a.className = this.a.className.replace("highslide-active-anchor", "");
            this.doShowHide("visible");
            if (this.outline && this.outlineWhileAnimating) {
                this.outline.destroy()
            }
            hs.discardElement(this.wrapper);
            hs.expanders[this.key] = null;
            hs.reOrder()
        }
    };
    hs.langDefaults = hs.lang;
    var HsExpander = hs.Expander;
    if (hs.ie && window == window.top) {
        (function () {
            try {
                document.documentElement.doScroll("left")
            } catch (a) {
                setTimeout(arguments.callee, 50);
                return
            }
            hs.ready()
        })()
    }
    hs.addEventListener(document, "DOMContentLoaded", hs.ready);
    hs.addEventListener(window, "load", hs.ready);
    hs.addEventListener(document, "ready", function () {
        if (hs.expandCursor) {
            var c = hs.createElement("style", {
                type: "text/css"
            }, null, document.getElementsByTagName("HEAD")[0]);

            function a(f, d) {
                if (hs.ie && hs.uaVersion < 9) {
                    var e = document.styleSheets[document.styleSheets.length - 1];
                    if (typeof (e.addRule) == "object") {
                        e.addRule(f, d)
                    }
                } else {
                    c.appendChild(document.createTextNode(f + " {" + d + "}"))
                }
            }
            function b(d) {
                return "expression( ( ( ignoreMe = document.documentElement." + d + " ? document.documentElement." + d + " : document.body." + d + " ) ) + 'px' );"
            }
            if (hs.expandCursor) {
                a(".highslide img", "cursor: url(" + hs.graphicsDir + hs.expandCursor + "), pointer !important;")
            }
        }
    });
    hs.addEventListener(window, "resize", function () {
        hs.getPageSize()
    });
    hs.addEventListener(document, "mousemove", function (a) {
        hs.mouse = {
            x: a.clientX,
            y: a.clientY
        }
    });
    hs.addEventListener(document, "mousedown", hs.mouseClickHandler);
    hs.addEventListener(document, "mouseup", hs.mouseClickHandler);
    hs.addEventListener(document, "ready", hs.getAnchors);
    hs.addEventListener(window, "load", hs.preloadImages)
};